""" 
@coding  : utf-8
@Time    : 2023/4/20 15:12
@Author  : Rumou
@File    : 字符串分类统计.py
@Description: 从键盘接受一串字符串，统计里面字母、数字、其他字符的个数
"""
num_count = 0
letter_count = 0
else_count = 0
input_str = input("请输入字符串：")
for i in input_str:
    if i.isdigit():  # 换成ASCII码更精准
        num_count += 1
    elif i.isalpha():
        letter_count += 1
    else:
        else_count += 1
print(f"字母个数:{letter_count}\n数字个数:{num_count}\n其他字符个数:{else_count}")
